<template>
  <div>
      <button  @click="decrement">-1</button>
      <button @click="increment">+1</button>
      <input type="text" @blur='inputCount' ref='newCount'>
  </div>
</template>

<script>
export default {
    props:['count'],
    data(){
        return {
        }
    },
    methods:{
        // increment(){
        //     this.$emit("increment")
        // },
        decrement(){
            this.$emit("decrement")
        },
        inputCount(){
            this.$emit("inputCount",this.$refs.newCount.value)
            this.$refs.newCount.value=''
        },
        increment(){
            let num = this.count
            num++;
            this.$emit("increment",num)
      }
    }
}
</script>

<style>

</style>